<?php
class StaticController extends BaseController
{
    public function __construct($uri)
    {
        parent::__construct($uri);
    }

    public function get()
    {
        $tmp = explode('/', $this->uri);
        $filename = $tmp[2];
        switch ($tmp[2]) {
        case 'all.css' :
            $like = '*.css';
            $this->output['http']['Content-Type'] = 'text/css';
            break;
        case 'all.js' :
            $like = '*.js';
            $this->output['http']['Content-Type'] = 'application/javascript';
            break;
        }
        $files = FileLib::getSubfiles(ConfLib::get('lnmp', 'view_dir') . 'default/', $like);
        $r = '';
        foreach($files as $one) {
            $r .= file_get_contents($one);
        }
        $this->output['data'] = $r;
        return $this->output;
    }
}
?>
